/*
 * ClienteFacadeBean.java
 *
 * Created on 5 de Junho de 2007, 22:05
 *
 */

package net.sf.jOpinionPoll.facade.impl;

import java.util.List;

import net.sf.jOpinionPoll.dao.ParameterMap;
import net.sf.jOpinionPoll.dao.AlternativaDao;
import net.sf.jOpinionPoll.dao.QuestaoDao;
import net.sf.jOpinionPoll.dao.QuestionarioDao;
import net.sf.jOpinionPoll.entity.Alternativa;
import net.sf.jOpinionPoll.entity.Questao;
import net.sf.jOpinionPoll.entity.Questionario;
import net.sf.jOpinionPoll.facade.QuestionarioFacade;

/**
 *
 * @author erico
 */
@SuppressWarnings("unchecked")
public class QuestionarioFacadeImpl implements QuestionarioFacade {
    private QuestionarioDao m_QuestionarioDao;
    private QuestaoDao m_QuestaoDao;
	private AlternativaDao m_AlternativaDao;
    
    public void setQuestionarioDao(QuestionarioDao questionarioDao) {
    	m_QuestionarioDao = questionarioDao;
    }
    
    public void setQuestaoDao(QuestaoDao questaoDao) {
    	m_QuestaoDao = questaoDao;
    }
	
	public void setAlternativaDao(AlternativaDao alternativaDao) {
    	m_AlternativaDao = alternativaDao;
    }
    
    @Override
    public Questionario findByPk(int id) {
        return m_QuestionarioDao.findByPk(id);
    }

    @Override
    public void add(Questionario questionario) {
   		m_QuestionarioDao.add(questionario);
    }
    
    @Override
    public void set(Questionario questionario) {
        m_QuestionarioDao.set(questionario);
    }
    
    @Override
    public void remove(Questionario questionario) {
        m_QuestionarioDao.remove(questionario);
    }
    
    @Override
    public int count() {
        return m_QuestionarioDao.count();
    }
    
    @Override
    public List<Questionario> list(int startReg, int length) {
    	return m_QuestionarioDao.list(startReg, length);
    }
    
    @Override
    public List<Questionario> listByParameters(int startReg, int length, ParameterMap parameterMap) {
    	return m_QuestionarioDao.list(startReg, length, parameterMap);
    }
    
	@Override
    public Questao findQuestaoByPk(int id) {
    	return m_QuestaoDao.findByPk(id);
    }
    
	@Override
    public void removeQuestao(Questao questao) {
    	m_QuestaoDao.remove(questao);
    }
	
	@Override
    public void setQuestao(Questao questao) {
        m_QuestaoDao.set(questao);
    }
	
	@Override
	public void removeAlternativa(Alternativa alternativa) {
		m_AlternativaDao.remove(alternativa);
	}
}